let _BigInt = Object.getOwnPropertyDescriptors(BigInt.prototype)

BigInt = newFunc('BigInt', 1, function () {
    print('BigInt.call');
    mm.memory.private_data.set(this, {})
});


;delete BigInt.prototype.constructor;
;
Object.defineProperties(BigInt.prototype, {
    [Symbol.toStringTag]: {
        value: 'BigInt'
    },

    'constructor': _BigInt.constructor,
    'toLocaleString': _BigInt.toLocaleString,
    'toString': _BigInt.toString,
    'valueOf': _BigInt.valueOf,
})

let _ArrayBuffer = Object.getOwnPropertyDescriptors(ArrayBuffer.prototype)
ArrayBuffer = newFunc('ArrayBuffer', 1, function () {
    print('ArrayBuffer.call');
    mm.memory.private_data.set(this, {})
});

;delete ArrayBuffer.prototype.constructor;
;
Object.defineProperties(ArrayBuffer.prototype, {
    [Symbol.toStringTag]: {
        value: 'ArrayBuffer'
    },

    'constructor': _ArrayBuffer.constructor,
    'byteLength': _ArrayBuffer.byteLength,
    'slice': _ArrayBuffer.slice,
    'maxByteLength': _ArrayBuffer.maxByteLength,
    'resizable': _ArrayBuffer.resizable,
    'resize': _ArrayBuffer.resize,
    'transfer': {

        value: newFunc('transfer', 10, function () {

            if (!ArrayBuffer.prototype.isPrototypeOf(this)) {
                throw new TypeError("Illegal constructor");
            }
            ;
            if (debug) print('ArrayBuffer.transfer.call', arguments)

        }), writable: true, enumerable: false, configurable: true,


    },
    'transferToFixedLength': {

        value: newFunc('transferToFixedLength', 10, function () {

            if (!ArrayBuffer.prototype.isPrototypeOf(this)) {
                throw new TypeError("Illegal constructor");
            }
            ;
            if (debug) print('ArrayBuffer.transferToFixedLength.call', arguments)

        }), writable: true, enumerable: false, configurable: true,


    },
    'detached': {

        get: newFunc('detached', 10, function () {


            if (!ArrayBuffer.prototype.isPrototypeOf(this)) {
                throw new TypeError("Illegal constructor");
            }
            ;

            let res = mm.memory.private_data.get(this)['detached'];
            if (debug) print('ArrayBuffer.detached.get', res)

            return res
        }, {get: true}), enumerable: false, configurable: true,

    },
})


let _TextEncoder = Object.getOwnPropertyDescriptors(TextEncoder.prototype);
TextEncoder = newFunc('TextEncoder', 1, function () {
    print('TextEncoder.call');
    mm.memory.private_data.set(this, {})
});


;delete TextEncoder.prototype.constructor;
;
Object.defineProperties(TextEncoder.prototype, {
    [Symbol.toStringTag]: {
        value: 'TextEncoder'
    },

    'encoding': _TextEncoder.encoding,
    'encode': _TextEncoder.encode,
    'encodeInto': _TextEncoder.encodeInto,
    'constructor': _TextEncoder.constructor
})


let _Boolean = Object.getOwnPropertyDescriptors(Boolean);
Boolean = newFunc('Boolean', 1, function () {
    print('Boolean.call');
    mm.memory.private_data.set(this, {})
});


;delete Boolean.prototype.constructor;
;
Object.defineProperties(Boolean.prototype, {
    'constructor': _Boolean.constructor,
    'toString': _Boolean.toString,
    'valueOf': _Boolean.valueOf,
})
let _Function = Object.getOwnPropertyDescriptors(Function.prototype)
// Function = newFunc('Function', 1, function () {
//     // print('Function.call');
//     // mm.memory.private_data.set(this, {})
// });


// ;delete Function.prototype.constructor;
// ;
// Object.defineProperties(Function.prototype, {
//     [Symbol.toStringTag]: {
//         value: 'Function'
//     },
//
//     'length': _Function.length,
//     'name': _Function.name,
//
//     'arguments': _Function.arguments,
//     'caller': _Function.caller,
//     'constructor': _Function.constructor,
//     'apply': _Function.apply,
//     'bind': _Function.bind,
//     'call': _Function.call,
//     'toString': _Function.toString,
// })
let nowTime = 1761984186549;
Date.now = function now() { return nowTime++ };
// times = 0
Math.random = function random() {
    // return 0.08636862211354912
    return 0.33333333
};
if (keepRandom === true) {
    let nowTime = 1719907617588;
    Date.now = function now() { return nowTime++ };
    // Date.parse = function () { return nowTime++ };
    // Date.prototype.valueOf = function () { return nowTime++ };
    // Date.prototype.getTime = function () { return nowTime++ };
    // // performance.now = function now(){ return 104536.6000000001}
    // // Math.random = function random() { return 0.08636862211354912 };
    // // crypto.getRandomValues = function(typedArray) {
    // //     let fixedValues = new Uint8Array([42, 17, 23, 5, 10, 9, 77, 8, 33, 6]);
    // //     for (let i = 0; i < typedArray.length; i++) {
    // //         typedArray[i] = fixedValues[i];
    // //     }return typedArray;
    // // };

    // Date.now = function now() {
    //     return 1729826079104
    // };
    // Date.parse = function () {
    //     return 1729826079104
    // };
    // Date.prototype.valueOf = function () {
    //     return 1729826079104
    // };
    // Date.prototype.getTime = function () {
    //     return 1729826079104
    // };
    // Date.prototype.toString = function () {
    //     return 1729826079104
    // };
    // // Performance.prototype.now = function now() {
    // //     return Number('1729826079104'.slice(8))
    // // }


//
}
// const params = new CronetEngineParams()
// params.enableQuic = true // by default
// const engine = new CronetEngine()
var mm = {
    globalListeners: {},
    net: {
        // engine:
    },
};
mm.abs = function (params, value) {
    return typeof (params) === "undefined" ? value : params
}
mm.safe_Objattribute = function (target, $safe_get_attribute, $safe_set_attribute, $safe_func_attribute) {
    let desces = Object.getOwnPropertyDescriptors(target.prototype)
    for (let i = 0; i < $safe_set_attribute.length; i++) {
        let set_attr = $safe_set_attribute[i];
        Object.defineProperty(target.prototype, set_attr, {
            set: newFunc(set_attr, 1, desces[set_attr].set, {set: true}),
            enumerable: true, configurable: true,
        })
    }
    for (let i = 0; i < $safe_get_attribute.length; i++) {
        let set_attr = $safe_get_attribute[i];
        Object.defineProperty(target.prototype, set_attr, {
            get: newFunc(set_attr, 0, desces[set_attr].get, {get: true}),
            enumerable: true, configurable: true,

        })
    }
    for (let i = 0; i < $safe_func_attribute.length; i++) {
        let set_attr = $safe_func_attribute[i];
        Object.defineProperty(target.prototype, set_attr, {
            value: newFunc(set_attr, 1, desces[set_attr].value),
            enumerable: true, configurable: true,

        })
    }

}


mm.memory = {
    $createObj_key: 'mm',       // 只有输入对的密码, 才能创建对象
    private_data: new WeakMap(),  // new出来的对象
    timer_map: {0: null},       // 定时器map
    plugin: {},
    mimeType: {},
    pluginArray: {},
    mimeTypeArray: {},
    listeners: new Map(),         // 保存添加的事件
    allListeners: new Map(),
    eventObj: {},
    htmlElements: {},             // 保存 createElement 方法创造节点需要用到得类
    runElementList: [],
    htmlCollection: [],           // 储存 getElementsByTagName， 返回的节点对象
    logs: [], // 日志储存
    cc: cc,
    script_name: script_name,
};
//去掉所有的空格（中文空格、英文空格都会被替换）
mm.compress_jsCode = function (string_js) {
    if (string_js.length >= 100) {
        let string = string_js.replace(/\r\n/g, "");
        string = string.replace(/\n/g, "");
        return string.replace(/\s/g, "").slice(0, 100) + "......";
    }
    return string_js
};
// mm.proxy = function (obj, objname, type) {
//     function get_attribute_type(value) {
//         return Object.prototype.toString.call(value);
//     }
//
//     function get_method_handler(watchName) {
//         return {
//             apply(target, thisArg, argArray) {
//                 let result = Reflect.apply(target, thisArg, argArray);
//                 if (thisArg === console && target.name === "log") {
//                     return result;
//                 }
//                 ;
//                 if (target.name === "toString") {
//                     return result;
//                 }
//                 ;
//                 if (debug) {
//                     print(`[${watchName}] apply function name is [${target.name}], argArray is [${argArray}], result is [${result}].`);
//                 }
//                 return result
//
//             },
//             construct(target, argArray, newTarget) {
//                 let result = Reflect.construct(target, argArray, newTarget);
//                 if (debug) {
//                     print(`[${watchName}] construct function name is [${target.name}], argArray is [${argArray}], result is [${(result)}].`);
//                 }
//                 return result;
//             }
//         }
//     }
//
//     function get_obj_handler(WatchName) {
//         return {
//             get(target, propKey, receiver) {
//                 if (propKey === "__proto__") {
//                     print(`getting propKey-> ${WatchName}.${propKey}  value-> ${(target[propKey])}`)
//                     return target[propKey]
//                 }
//                 ;
//
//                 let result = Reflect.get(target, propKey, receiver);
//                 let result_type = get_attribute_type(result);
//
//                 if (result instanceof Object) {
//                     if (Object.getOwnPropertyDescriptor(target, propKey) && Object.getOwnPropertyDescriptor(target, propKey).writable === false) {
//                         print(`getting propKey-> ${WatchName}.${propKey} it is non-writable`)
//                     } else {
//                         if (typeof result === "function") {
//                             if (debug) {
//
//                                 print(`getting propKey-> ${WatchName}.${propKey}  value-> ${mm.compress_jsCode(String(result))}  typeof-> ${result_type}`);
//                             }
//                             // return new Proxy(result, get_method_handler(WatchName))
//                             return result
//                         } else {
//                             if (debug) {
//                                 print(`\ngetting propKey-> ${WatchName}.${propKey}  value-> ${mm.compress_jsCode(String(result))}  typeof-> ${result_type}`);
//                             }
//                         }
//                         return new Proxy(result, get_obj_handler(`${WatchName}.${propKey}`))
//                     }
//
//                 }
//                 if (typeof (propKey) !== "symbol" && propKey !== "toString") {
//                     try {
//                         if (debug) {
//                             print(`\ngetting propKey-> ${WatchName}.${propKey.description ?? propKey}  result-> ${result}  typeof-> ${result_type}`);
//                         }
//                     } catch (e) {
//                         print(`[${WatchName}] getting error`);
//                     }
//                 }
//                 return result;
//             },
//             set(target, propKey, value, receiver) {
//                 let value_type = get_attribute_type(value);
//                 if (value instanceof Object) {
//                     if (debug) {
//                         print(`\nsetting propKey-> ${WatchName}.${propKey}  value-> ${mm.compress_jsCode(String(value))}  typeof-> ${value_type}`);
//                     }
//                 } else {
//                     if (debug) {
//                         print(`\nsetting propKey-> ${WatchName}.${propKey}  value-> ${mm.compress_jsCode(String(value))}  typeof-> ${value_type}`);
//                     }
//                 }
//                 return Reflect.set(target, propKey, value, receiver);
//             },
//             has(target, propKey) {
//                 let result = Reflect.has(target, propKey);
//                 if (debug) {
//                     print(`has propKey-> ${WatchName}.${propKey}, result-> ${result}`);
//                 }
//                 return result;
//             },
//             deleteProperty(target, propKey) {
//                 let result = Reflect.deleteProperty(target, propKey);
//                 if (debug) {
//                     print(`delete propKey-> ${WatchName}.${propKey}, result-> ${result}`);
//                 }
//                 return result;
//             },
//             // getOwnPropertyDescriptor(target, propKey) {
//             //     let result = Reflect.getOwnPropertyDescriptor(target, propKey);
//             //     if (debug) {
//             //         try {
//             //              print(`getOwnPropertyDescriptor  propKey-> ${WatchName}.${propKey} result-> ${(String(result))}`);
//             //         } catch (error) { }
//             //     }
//             //     return result;
//             // },
//             defineProperty(target, propKey, attributes) {
//                 let result = Reflect.defineProperty(target, propKey, attributes);
//                 try {
//                     if (debug) {
//                         print(`defineProperty propKey-> ${WatchName}.${propKey} attributes is [${(attributes)}], result is [${result}]`);
//                     }
//                 } catch (e) {
//                     print(`[${WatchName}] defineProperty error`)
//                 }
//                 return result;
//             },
//             getPrototypeOf(target) {
//                 let result = Reflect.getPrototypeOf(target);
//                 if (debug) {
//                     print(`[${WatchName}] getPrototypeOf result is [${(result)}]`);
//                 }
//                 return result;
//             },
//             setPrototypeOf(target, proto) {
//                 let result = Reflect.setPrototypeOf(target, proto);
//                 if (debug) {
//                     print(`[${WatchName}] setPrototypeOf proto is [${(proto)}], result is [${result}]`);
//                 }
//                 return result;
//             },
//             preventExtensions(target) {
//                 let result = Reflect.preventExtensions(target);
//                 if (debug) {
//                     print(`[${WatchName}] preventExtensions, result is [${result}]`);
//                 }
//                 return result;
//             },
//             isExtensible(target) {
//                 let result = Reflect.isExtensible(target);
//                 if (debug) {
//                     print(`[${WatchName}] isExtensible, result is [${result}]`);
//                 }
//                 return result;
//             },
//             // ownKeys(target) {
//             //     let result = Reflect.ownKeys(target);
//             //     if (debug) {
//             //         try {
//             //              print(`[${WatchName}] invoke ownkeys, result is [${String(result)}]`);
//             //         } catch (error) {
//             //
//             //         }
//             //     }
//             //     return result
//             // }
//         }
//     }
//
//
//     // if (type === "method") {
//     if (typeof obj === "function") {
//         // return new Proxy(obj, get_method_handler(objname));
//         return obj
//     }
//     return new Proxy(obj, get_obj_handler(objname));
// };

const proxx = function (tt, name) {
    // return tt
    return new Proxy(tt, {
        get(target, p, receiver) {
            let res = Reflect.get(target, p, receiver);
            // if (p !== 'debug' && p !== 'Object') {
            //         if (!['Array', 'Math', 'Function', 'Object', 'ENV'].includes(p))
            print(`${name} get`, p, typeof res
                // , res
            )
            // if (p === '_context2d' && res === undefined){
            // if(name === 'canvas' && p === 'width' && typeof res === undefined){
            //     debugger
            // }
            // if (name === 'imageDatas' && typeof res === undefined){
            //     //todo
            //     return [214, 122, 6, 255];
            // }

            // }
            if (p === 'offsetHeight') {
                debugger;
            }
            // print(Reflect.get(target, '_cf_chl_ctx', receiver))

            if (!['_registeredHandlers', '_currentEvent', 'performance', 'debug', '_eventListenerss', 'top', 'prototype', '_canvas', '_context'].includes(p) && res && typeof res === 'object' && typeof p !== 'symbol') {
                return proxx(res, p)
            }
            return res;
        },

        set(target, p, newValue, receiver) {
            print(`${name} set`, p, newValue)
            debugger;
            return Reflect.set(target, p, newValue, receiver);
        }
    })
}
mm.proxy = proxx


/**
 * 清除定时器的事件循环
 */
deleteTimerEventLoop = function () {
    for (let timerId in mm.memory.timer_map) {
        clearTimeout(timerId);
    }
    for (let timerId in mm.memory.timer_map) {
        clearInterval(timerId);
    }
    mm.memory.timerId = 0;      // 定时器id保存
    mm.memory.timer_map = {};   // 定时器
};

_getPrototypeOf = Object.getPrototypeOf;
Object.getPrototypeOf = function (a) {
    print('getPrototypeOf', a.toString())
    return _getPrototypeOf.apply(this, arguments)
}
_getOwnPropertyNames = Object.getOwnPropertyNames;


Object.getOwnPropertyNames = newFunc('getOwnPropertyNames', 1, function (a) {
    let res = _getOwnPropertyNames(a);
    // debugger;

    // for (let i = 0; i < ownKeyss; i++) {
    //     let keys = ownKeyss[i];
    //     let keysSplit = keys.split('--');
    //     if (res.includes(keysSplit[0]) && res.includes(keysSplit[1])){
    //         res = keyss[keys]
    //     }
    //
    // }


    if ((res+'').startsWith('parent,hasAppend,TextEncoder,console,scriptEnvLen,CookieJar,cc,atob,DOM')){
        res = 'Object,Function,Array,Number,parseFloat,parseInt,Infinity,NaN,undefined,Boolean,String,Symbol,Date,Promise,RegExp,Error,AggregateError,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis,JSON,Math,Intl,ArrayBuffer,Atomics,Uint8Array,Int8Array,Uint16Array,Int16Array,Uint32Array,Int32Array,BigUint64Array,BigInt64Array,Uint8ClampedArray,Float32Array,Float64Array,DataView,Map,BigInt,Set,Iterator,WeakMap,WeakSet,Proxy,Reflect,FinalizationRegistry,WeakRef,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,unescape,eval,isFinite,isNaN,console,Option,Image,Audio,webkitURL,webkitRTCPeerConnection,webkitMediaStream,WebKitMutationObserver,WebKitCSSMatrix,XSLTProcessor,XPathResult,XPathExpression,XPathEvaluator,XMLSerializer,XMLHttpRequestUpload,XMLHttpRequestEventTarget,XMLHttpRequest,XMLDocument,WritableStreamDefaultWriter,WritableStreamDefaultController,WritableStream,Worker,WindowControlsOverlayGeometryChangeEvent,WindowControlsOverlay,Window,WheelEvent,WebSocket,WebGLVertexArrayObject,WebGLUniformLocation,WebGLTransformFeedback,WebGLTexture,WebGLSync,WebGLShaderPrecisionFormat,WebGLShader,WebGLSampler,WebGLRenderingContext,WebGLRenderbuffer,WebGLQuery,WebGLProgram,WebGLObject,WebGLFramebuffer,WebGLContextEvent,WebGLBuffer,WebGLActiveInfo,WebGL2RenderingContext,WaveShaperNode,VisualViewport,VisibilityStateEntry,VirtualKeyboardGeometryChangeEvent,ViewTransitionTypeSet,ViewTransition,ViewTimeline,VideoPlaybackQuality,VideoFrame,VideoColorSpace,ValidityState,VTTCue,UserActivation,URLSearchParams,URLPattern,URL,UIEvent,TrustedTypePolicyFactory,TrustedTypePolicy,TrustedScriptURL,TrustedScript,TrustedHTML,TreeWalker,TransitionEvent,TransformStreamDefaultController,TransformStream,TrackEvent,TouchList,TouchEvent,Touch,ToggleEvent,TimeRanges,TextUpdateEvent,TextTrackList,TextTrackCueList,TextTrackCue,TextTrack,TextMetrics,TextFormatUpdateEvent,TextFormat,TextEvent,TextEncoderStream,TextEncoder,TextDecoderStream,TextDecoder,Text,TaskSignal,TaskPriorityChangeEvent,TaskController,TaskAttributionTiming,SyncManager,Subscriber,SubmitEvent,StyleSheetList,StyleSheet,StylePropertyMapReadOnly,StylePropertyMap,StorageEvent,Storage,StereoPannerNode,StaticRange,SourceBufferList,SourceBuffer,ShadowRoot,Selection,SecurityPolicyViolationEvent,ScrollTimeline,ScriptProcessorNode,ScreenOrientation,Screen,Scheduling,Scheduler,SVGViewElement,SVGUseElement,SVGUnitTypes,SVGTransformList,SVGTransform,SVGTitleElement,SVGTextPositioningElement,SVGTextPathElement,SVGTextElement,SVGTextContentElement,SVGTSpanElement,SVGSymbolElement,SVGSwitchElement,SVGStyleElement,SVGStringList,SVGStopElement,SVGSetElement,SVGScriptElement,SVGSVGElement,SVGRectElement,SVGRect,SVGRadialGradientElement,SVGPreserveAspectRatio,SVGPolylineElement,SVGPolygonElement,SVGPointList,SVGPoint,SVGPatternElement,SVGPathElement,SVGNumberList,SVGNumber,SVGMetadataElement,SVGMatrix,SVGMaskElement,SVGMarkerElement,SVGMPathElement,SVGLinearGradientElement,SVGLineElement,SVGLengthList,SVGLength,SVGImageElement,SVGGraphicsElement,SVGGradientElement,SVGGeometryElement,SVGGElement,SVGForeignObjectElement,SVGFilterElement,SVGFETurbulenceElement,SVGFETileElement,SVGFESpotLightElement,SVGFESpecularLightingElement,SVGFEPointLightElement,SVGFEOffsetElement,SVGFEMorphologyElement,SVGFEMergeNodeElement,SVGFEMergeElement,SVGFEImageElement,SVGFEGaussianBlurElement,SVGFEFuncRElement,SVGFEFuncGElement,SVGFEFuncBElement,SVGFEFuncAElement,SVGFEFloodElement,SVGFEDropShadowElement,SVGFEDistantLightElement,SVGFEDisplacementMapElement,SVGFEDiffuseLightingElement,SVGFEConvolveMatrixElement,SVGFECompositeElement,SVGFEComponentTransferElement,SVGFEColorMatrixElement,SVGFEBlendElement,SVGEllipseElement,SVGElement,SVGDescElement,SVGDefsElement,SVGComponentTransferFunctionElement,SVGClipPathElement,SVGCircleElement,SVGAnimationElement,SVGAnimatedTransformList,SVGAnimatedString,SVGAnimatedRect,SVGAnimatedPreserveAspectRatio,SVGAnimatedNumberList,SVGAnimatedNumber,SVGAnimatedLengthList,SVGAnimatedLength,SVGAnimatedInteger,SVGAnimatedEnumeration,SVGAnimatedBoolean,SVGAnimatedAngle,SVGAnimateTransformElement,SVGAnimateMotionElement,SVGAnimateElement,SVGAngle,SVGAElement,Response,ResizeObserverSize,ResizeObserverEntry,ResizeObserver,Request,ReportingObserver,ReportBody,ReadableStreamDefaultReader,ReadableStreamDefaultController,ReadableStreamBYOBRequest,ReadableStreamBYOBReader,ReadableStream,ReadableByteStreamController,Range,RadioNodeList,RTCTrackEvent,RTCStatsReport,RTCSessionDescription,RTCSctpTransport,RTCRtpTransceiver,RTCRtpSender,RTCRtpReceiver,RTCPeerConnectionIceEvent,RTCPeerConnectionIceErrorEvent,RTCPeerConnection,RTCIceTransport,RTCIceCandidate,RTCErrorEvent,RTCError,RTCEncodedVideoFrame,RTCEncodedAudioFrame,RTCDtlsTransport,RTCDataChannelEvent,RTCDTMFToneChangeEvent,RTCDTMFSender,RTCCertificate,PromiseRejectionEvent,ProgressEvent,Profiler,ProcessingInstruction,PopStateEvent,PointerEvent,PluginArray,Plugin,PictureInPictureWindow,PictureInPictureEvent,PeriodicWave,PerformanceTiming,PerformanceServerTiming,PerformanceScriptTiming,PerformanceResourceTiming,PerformancePaintTiming,PerformanceObserverEntryList,PerformanceObserver,PerformanceNavigationTiming,PerformanceNavigation,PerformanceMeasure,PerformanceMark,PerformanceLongTaskTiming,PerformanceLongAnimationFrameTiming,PerformanceEventTiming,PerformanceEntry,PerformanceElementTiming,Performance,Path2D,PannerNode,PageTransitionEvent,OverconstrainedError,OscillatorNode,OffscreenCanvasRenderingContext2D,OffscreenCanvas,OfflineAudioContext,OfflineAudioCompletionEvent,Observable,NodeList,NodeIterator,NodeFilter,Node,NetworkInformation,NavigatorUAData,Navigator,NavigationTransition,NavigationHistoryEntry,NavigationDestination,NavigationCurrentEntryChangeEvent,NavigationActivation,Navigation,NavigateEvent,NamedNodeMap,MutationRecord,MutationObserver,MouseEvent,MimeTypeArray,MimeType,MessagePort,MessageEvent,MessageChannel,MediaStreamTrackVideoStats,MediaStreamTrackProcessor,MediaStreamTrackGenerator,MediaStreamTrackEvent,MediaStreamTrackAudioStats,MediaStreamTrack,MediaStreamEvent,MediaStreamAudioSourceNode,MediaStreamAudioDestinationNode,MediaStream,MediaSourceHandle,MediaSource,MediaRecorder,MediaQueryListEvent,MediaQueryList,MediaList,MediaError,MediaEncryptedEvent,MediaElementAudioSourceNode,MediaCapabilities,MathMLElement,Location,LayoutShiftAttribution,LayoutShift,LargestContentfulPaint,KeyframeEffect,KeyboardEvent,IntersectionObserverEntry,IntersectionObserver,InputEvent,InputDeviceInfo,InputDeviceCapabilities,Ink,ImageData,ImageBitmapRenderingContext,ImageBitmap,IdleDeadline,IIRFilterNode,IDBVersionChangeEvent,IDBTransaction,IDBRequest,IDBOpenDBRequest,IDBObjectStore,IDBKeyRange,IDBIndex,IDBFactory,IDBDatabase,IDBCursorWithValue,IDBCursor,History,HighlightRegistry,Highlight,Headers,HashChangeEvent,HTMLVideoElement,HTMLUnknownElement,HTMLUListElement,HTMLTrackElement,HTMLTitleElement,HTMLTimeElement,HTMLTextAreaElement,HTMLTemplateElement,HTMLTableSectionElement,HTMLTableRowElement,HTMLTableElement,HTMLTableColElement,HTMLTableCellElement,HTMLTableCaptionElement,HTMLStyleElement,HTMLSpanElement,HTMLSourceElement,HTMLSlotElement,HTMLSelectElement,HTMLScriptElement,HTMLQuoteElement,HTMLProgressElement,HTMLPreElement,HTMLPictureElement,HTMLParamElement,HTMLParagraphElement,HTMLOutputElement,HTMLOptionsCollection,HTMLOptionElement,HTMLOptGroupElement,HTMLObjectElement,HTMLOListElement,HTMLModElement,HTMLMeterElement,HTMLMetaElement,HTMLMenuElement,HTMLMediaElement,HTMLMarqueeElement,HTMLMapElement,HTMLLinkElement,HTMLLegendElement,HTMLLabelElement,HTMLLIElement,HTMLInputElement,HTMLImageElement,HTMLIFrameElement,HTMLHtmlElement,HTMLHeadingElement,HTMLHeadElement,HTMLHRElement,HTMLFrameSetElement,HTMLFrameElement,HTMLFormElement,HTMLFormControlsCollection,HTMLFontElement,HTMLFieldSetElement,HTMLEmbedElement,HTMLElement,HTMLDocument,HTMLDivElement,HTMLDirectoryElement,HTMLDialogElement,HTMLDetailsElement,HTMLDataListElement,HTMLDataElement,HTMLDListElement,HTMLCollection,HTMLCanvasElement,HTMLButtonElement,HTMLBodyElement,HTMLBaseElement,HTMLBRElement,HTMLAudioElement,HTMLAreaElement,HTMLAnchorElement,HTMLAllCollection,GeolocationPositionError,GeolocationPosition,GeolocationCoordinates,Geolocation,GamepadHapticActuator,GamepadEvent,GamepadButton,Gamepad,GainNode,FormDataEvent,FormData,FontFaceSetLoadEvent,FontFace,FocusEvent,FileReader,FileList,File,FeaturePolicy,External,EventTarget,EventSource,EventCounts,Event,ErrorEvent,EncodedVideoChunk,EncodedAudioChunk,ElementInternals,Element,EditContext,DynamicsCompressorNode,DragEvent,DocumentType,DocumentTimeline,DocumentFragment,Document,DelegatedInkTrailPresenter,DelayNode,DecompressionStream,DataTransferItemList,DataTransferItem,DataTransfer,DOMTokenList,DOMStringMap,DOMStringList,DOMRectReadOnly,DOMRectList,DOMRect,DOMQuad,DOMPointReadOnly,DOMPoint,DOMParser,DOMMatrixReadOnly,DOMMatrix,DOMImplementation,DOMException,DOMError,CustomStateSet,CustomEvent,CustomElementRegistry,Crypto,CountQueuingStrategy,ConvolverNode,ContentVisibilityAutoStateChangeEvent,ConstantSourceNode,CompressionStream,CompositionEvent,Comment,CommandEvent,CloseWatcher,CloseEvent,ClipboardEvent,CharacterData,CharacterBoundsUpdateEvent,ChannelSplitterNode,ChannelMergerNode,CaretPosition,CanvasRenderingContext2D,CanvasPattern,CanvasGradient,CanvasCaptureMediaStreamTrack,CSSViewTransitionRule,CSSVariableReferenceValue,CSSUnparsedValue,CSSUnitValue,CSSTranslate,CSSTransition,CSSTransformValue,CSSTransformComponent,CSSSupportsRule,CSSStyleValue,CSSStyleSheet,CSSStyleRule,CSSStyleDeclaration,CSSStartingStyleRule,CSSSkewY,CSSSkewX,CSSSkew,CSSScopeRule,CSSScale,CSSRuleList,CSSRule,CSSRotate,CSSPropertyRule,CSSPositionValue,CSSPositionTryRule,CSSPositionTryDescriptors,CSSPerspective,CSSPageRule,CSSNumericValue,CSSNumericArray,CSSNestedDeclarations,CSSNamespaceRule,CSSMediaRule,CSSMatrixComponent,CSSMathValue,CSSMathSum,CSSMathProduct,CSSMathNegate,CSSMathMin,CSSMathMax,CSSMathInvert,CSSMathClamp,CSSMarginRule,CSSLayerStatementRule,CSSLayerBlockRule,CSSKeywordValue,CSSKeyframesRule,CSSKeyframeRule,CSSImportRule,CSSImageValue,CSSGroupingRule,CSSFontPaletteValuesRule,CSSFontFaceRule,CSSCounterStyleRule,CSSContainerRule,CSSConditionRule,CSSAnimation,CSS,CSPViolationReportBody,CDATASection,ByteLengthQueuingStrategy,BrowserCaptureMediaStreamTrack,BroadcastChannel,BlobEvent,Blob,BiquadFilterNode,BeforeUnloadEvent,BeforeInstallPromptEvent,BaseAudioContext,BarProp,AudioWorkletNode,AudioSinkInfo,AudioScheduledSourceNode,AudioProcessingEvent,AudioParamMap,AudioParam,AudioNode,AudioListener,AudioDestinationNode,AudioData,AudioContext,AudioBufferSourceNode,AudioBuffer,Attr,AnimationTimeline,AnimationPlaybackEvent,AnimationEvent,AnimationEffect,Animation,AnalyserNode,AbstractRange,AbortSignal,AbortController,window,self,document,name,location,customElements,history,navigation,locationbar,menubar,personalbar,scrollbars,statusbar,toolbar,status,closed,frames,length,top,opener,parent,frameElement,navigator,origin,external,screen,innerWidth,innerHeight,scrollX,pageXOffset,scrollY,pageYOffset,visualViewport,screenX,screenY,outerWidth,outerHeight,devicePixelRatio,event,clientInformation,offscreenBuffering,screenLeft,screenTop,styleMedia,onsearch,trustedTypes,performance,onappinstalled,onbeforeinstallprompt,crypto,indexedDB,sessionStorage,localStorage,onbeforexrselect,onabort,onbeforeinput,onbeforematch,onbeforetoggle,onblur,oncancel,oncanplay,oncanplaythrough,onchange,onclick,onclose,oncommand,oncontentvisibilityautostatechange,oncontextlost,oncontextmenu,oncontextrestored,oncuechange,ondblclick,ondrag,ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,onfocus,onformdata,oninput,oninvalid,onkeydown,onkeypress,onkeyup,onload,onloadeddata,onloadedmetadata,onloadstart,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,onmouseover,onmouseup,onmousewheel,onpause,onplay,onplaying,onprogress,onratechange,onreset,onresize,onscroll,onscrollend,onsecuritypolicyviolation,onseeked,onseeking,onselect,onslotchange,onstalled,onsubmit,onsuspend,ontimeupdate,ontoggle,onvolumechange,onwaiting,onwebkitanimationend,onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,onauxclick,ongotpointercapture,onlostpointercapture,onpointerdown,onpointermove,onpointerrawupdate,onpointerup,onpointercancel,onpointerover,onpointerout,onpointerenter,onpointerleave,onselectstart,onselectionchange,onanimationend,onanimationiteration,onanimationstart,ontransitionrun,ontransitionstart,ontransitionend,ontransitioncancel,onafterprint,onbeforeprint,onbeforeunload,onhashchange,onlanguagechange,onmessage,onmessageerror,onoffline,ononline,onpagehide,onpageshow,onpopstate,onrejectionhandled,onstorage,onunhandledrejection,onunload,isSecureContext,crossOriginIsolated,scheduler,alert,atob,blur,btoa,cancelAnimationFrame,cancelIdleCallback,captureEvents,clearInterval,clearTimeout,close,confirm,createImageBitmap,fetch,find,focus,getComputedStyle,getSelection,matchMedia,moveBy,moveTo,open,postMessage,print,prompt,queueMicrotask,releaseEvents,reportError,requestAnimationFrame,requestIdleCallback,resizeBy,resizeTo,scroll,scrollBy,scrollTo,setInterval,setTimeout,stop,structuredClone,webkitCancelAnimationFrame,webkitRequestAnimationFrame,SuppressedError,DisposableStack,AsyncDisposableStack,Float16Array,chrome,WebAssembly,caches,cookieStore,ondevicemotion,ondeviceorientation,ondeviceorientationabsolute,documentPictureInPicture,sharedStorage,AbsoluteOrientationSensor,Accelerometer,AudioDecoder,AudioEncoder,AudioWorklet,BatteryManager,Cache,CacheStorage,Clipboard,ClipboardItem,CookieChangeEvent,CookieStore,CookieStoreManager,Credential,CredentialsContainer,CryptoKey,DeviceMotionEvent,DeviceMotionEventAcceleration,DeviceMotionEventRotationRate,DeviceOrientationEvent,FederatedCredential,GPU,GPUAdapter,GPUAdapterInfo,GPUBindGroup,GPUBindGroupLayout,GPUBuffer,GPUBufferUsage,GPUCanvasContext,GPUColorWrite,GPUCommandBuffer,GPUCommandEncoder,GPUCompilationInfo,GPUCompilationMessage,GPUComputePassEncoder,GPUComputePipeline,GPUDevice,GPUDeviceLostInfo,GPUError,GPUExternalTexture,GPUInternalError,GPUMapMode,GPUOutOfMemoryError,GPUPipelineError,GPUPipelineLayout,GPUQuerySet,GPUQueue,GPURenderBundle,GPURenderBundleEncoder,GPURenderPassEncoder,GPURenderPipeline,GPUSampler,GPUShaderModule,GPUShaderStage,GPUSupportedFeatures,GPUSupportedLimits,GPUTexture,GPUTextureUsage,GPUTextureView,GPUUncapturedErrorEvent,GPUValidationError,GravitySensor,Gyroscope,IdleDetector,ImageCapture,ImageDecoder,ImageTrack,ImageTrackList,Keyboard,KeyboardLayoutMap,LinearAccelerationSensor,MIDIAccess,MIDIConnectionEvent,MIDIInput,MIDIInputMap,MIDIMessageEvent,MIDIOutput,MIDIOutputMap,MIDIPort,MediaDeviceInfo,MediaDevices,MediaKeyMessageEvent,MediaKeySession,MediaKeyStatusMap,MediaKeySystemAccess,MediaKeys,NavigationPreloadManager,NavigatorManagedData,OrientationSensor,PasswordCredential,ProtectedAudience,RelativeOrientationSensor,ScreenDetailed,ScreenDetails,Sensor,SensorErrorEvent,ServiceWorkerRegistration,StorageManager,SubtleCrypto,VideoDecoder,VideoEncoder,VirtualKeyboard,WGSLLanguageFeatures,WebTransport,WebTransportBidirectionalStream,WebTransportDatagramDuplexStream,WebTransportError,Worklet,XRDOMOverlayState,XRLayer,XRWebGLBinding,AuthenticatorAssertionResponse,AuthenticatorAttestationResponse,AuthenticatorResponse,PublicKeyCredential,BarcodeDetector,Bluetooth,BluetoothCharacteristicProperties,BluetoothDevice,BluetoothRemoteGATTCharacteristic,BluetoothRemoteGATTDescriptor,BluetoothRemoteGATTServer,BluetoothRemoteGATTService,CaptureController,CreateMonitor,DevicePosture,DocumentPictureInPicture,EyeDropper,FetchLaterResult,FileSystemDirectoryHandle,FileSystemFileHandle,FileSystemHandle,FileSystemWritableFileStream,FileSystemObserver,FontData,FragmentDirective,HID,HIDConnectionEvent,HIDDevice,HIDInputReportEvent,IdentityCredential,IdentityCredentialError,IdentityProvider,NavigatorLogin,LanguageDetector,Lock,LockManager,ServiceWorker,ServiceWorkerContainer,NotRestoredReasonDetails,NotRestoredReasons,OTPCredential,PaymentAddress,PaymentRequest,PaymentRequestUpdateEvent,PaymentResponse,PaymentManager,PaymentMethodChangeEvent,Presentation,PresentationAvailability,PresentationConnection,PresentationConnectionAvailableEvent,PresentationConnectionCloseEvent,PresentationConnectionList,PresentationReceiver,PresentationRequest,PressureObserver,PressureRecord,Serial,SerialPort,SharedWorker,StorageBucket,StorageBucketManager,Summarizer,Translator,USB,USBAlternateInterface,USBConfiguration,USBConnectionEvent,USBDevice,USBEndpoint,USBInTransferResult,USBInterface,USBIsochronousInTransferPacket,USBIsochronousInTransferResult,USBIsochronousOutTransferPacket,USBIsochronousOutTransferResult,USBOutTransferResult,WakeLock,WakeLockSentinel,XRAnchor,XRAnchorSet,XRBoundedReferenceSpace,XRCPUDepthInformation,XRCamera,XRDepthInformation,XRFrame,XRHand,XRHitTestResult,XRHitTestSource,XRInputSource,XRInputSourceArray,XRInputSourceEvent,XRInputSourcesChangeEvent,XRJointPose,XRJointSpace,XRLightEstimate,XRLightProbe,XRPose,XRRay,XRReferenceSpace,XRReferenceSpaceEvent,XRRenderState,XRRigidTransform,XRSession,XRSessionEvent,XRSpace,XRSystem,XRTransientInputHitTestResult,XRTransientInputHitTestSource,XRView,XRViewerPose,XRViewport,XRWebGLDepthInformation,XRWebGLLayer,fetchLater,getScreenDetails,queryLocalFonts,showDirectoryPicker,showOpenFilePicker,showSaveFilePicker,originAgentCluster,viewport,onpageswap,onpagereveal,credentialless,fence,launchQueue,speechSynthesis,onscrollsnapchange,onscrollsnapchanging,BackgroundFetchManager,BackgroundFetchRecord,BackgroundFetchRegistration,BluetoothUUID,CSSFontFeatureValuesRule,CSSFunctionDeclarations,CSSFunctionDescriptors,CSSFunctionRule,ChapterInformation,CropTarget,DocumentPictureInPictureEvent,Fence,FencedFrameConfig,HTMLFencedFrameElement,HTMLSelectedContentElement,IntegrityViolationReportBody,LaunchParams,LaunchQueue,MediaMetadata,MediaSession,Notification,PageRevealEvent,PageSwapEvent,PeriodicSyncManager,PermissionStatus,Permissions,PushManager,PushSubscription,PushSubscriptionOptions,QuotaExceededError,RTCDataChannel,RemotePlayback,RestrictionTarget,SharedStorage,SharedStorageWorklet,SharedStorageAppendMethod,SharedStorageClearMethod,SharedStorageDeleteMethod,SharedStorageModifierMethod,SharedStorageSetMethod,SnapEvent,SpeechGrammar,SpeechGrammarList,SpeechRecognition,SpeechRecognitionErrorEvent,SpeechRecognitionEvent,SpeechSynthesis,SpeechSynthesisErrorEvent,SpeechSynthesisEvent,SpeechSynthesisUtterance,SpeechSynthesisVoice,Viewport,WebSocketError,WebSocketStream,webkitSpeechGrammar,webkitSpeechGrammarList,webkitSpeechRecognition,webkitSpeechRecognitionError,webkitSpeechRecognitionEvent,webkitRequestFileSystem,webkitResolveLocalFileSystemURL'.split(',')
    }
    if (a instanceof Keyboard) {
        res = [
            "getLayoutMap",
            "lock",
            "unlock",
            "constructor"
        ]
    }

    if (res.includes('setUTCMinutes')) {
        res = [
            "constructor",
            "toString",
            "toDateString",
            "toTimeString",
            "toISOString",
            "toUTCString",
            "toGMTString",
            "getDate",
            "setDate",
            "getDay",
            "getFullYear",
            "setFullYear",
            "getHours",
            "setHours",
            "getMilliseconds",
            "setMilliseconds",
            "getMinutes",
            "setMinutes",
            "getMonth",
            "setMonth",
            "getSeconds",
            "setSeconds",
            "getTime",
            "setTime",
            "getTimezoneOffset",
            "getUTCDate",
            "setUTCDate",
            "getUTCDay",
            "getUTCFullYear",
            "setUTCFullYear",
            "getUTCHours",
            "setUTCHours",
            "getUTCMilliseconds",
            "setUTCMilliseconds",
            "getUTCMinutes",
            "setUTCMinutes",
            "getUTCMonth",
            "setUTCMonth",
            "getUTCSeconds",
            "setUTCSeconds",
            "valueOf",
            "getYear",
            "setYear",
            "toJSON",
            "toLocaleString",
            "toLocaleDateString",
            "toLocaleTimeString"
        ]
    }
    if (res.includes('getLayoutMap')) {
        res = [
            "getLayoutMap",
            "lock",
            "unlock",
            "constructor"
        ]
    }



    if (res.includes('vLink')) {
        res = ['text', 'link', 'vLink', 'aLink', 'bgColor', 'background', 'onblur', 'onerror', 'onfocus', 'onload', 'onresize', 'onscroll', 'onafterprint', 'onbeforeprint', 'onbeforeunload', 'onhashchange', 'onlanguagechange', 'onmessage', 'onmessageerror', 'onoffline', 'ononline', 'onpagehide', 'onpageshow', 'onpopstate', 'onrejectionhandled', 'onstorage', 'onunhandledrejection', 'onunload', 'constructor']

    }
    if (res.includes('navigationPreload')) {
        res = ['installing', 'waiting', 'active', 'navigationPreload', 'scope', 'updateViaCache', 'onupdatefound', 'unregister', 'update', 'paymentManager', 'constructor', 'backgroundFetch', 'periodicSync', 'sync', 'cookies', 'pushManager', 'getNotifications', 'showNotification']
    }
    // if (res.includes('referrerPolicy') && !res.includes('hreflang') && !res.includes('border') && !res.includes('defer')) {
    //     res = ['src', 'srcdoc', 'name', 'sandbox', 'allowFullscreen', 'width', 'height', 'contentDocument', 'contentWindow', 'referrerPolicy', 'csp', 'allow', 'featurePolicy', 'align', 'scrolling', 'frameBorder', 'longDesc', 'marginHeight', 'marginWidth', 'getSVGDocument', 'loading', 'credentialless', 'allowPaymentRequest', 'constructor']
    // }

    if (res.includes('reduceRight') && res.includes('toReversed')) {
        res = [
            "length",
            "constructor",
            "at",
            "concat",
            "copyWithin",
            "fill",
            "find",
            "findIndex",
            "findLast",
            "findLastIndex",
            "lastIndexOf",
            "pop",
            "push",
            "reverse",
            "shift",
            "unshift",
            "slice",
            "sort",
            "splice",
            "includes",
            "indexOf",
            "join",
            "keys",
            "entries",
            "values",
            "forEach",
            "filter",
            "flat",
            "flatMap",
            "map",
            "every",
            "some",
            "reduce",
            "reduceRight",
            "toReversed",
            "toSorted",
            "toSpliced",
            "with",
            "toLocaleString",
            "toString"
        ]
    }
    if (!res.includes('UNPACK_SKIP_ROWS') && res.includes('BLEND_COLOR')) {
        res = [
            "canvas",
            "drawingBufferWidth",
            "drawingBufferHeight",
            "drawingBufferColorSpace",
            "unpackColorSpace",
            "DEPTH_BUFFER_BIT",
            "STENCIL_BUFFER_BIT",
            "COLOR_BUFFER_BIT",
            "POINTS",
            "LINES",
            "LINE_LOOP",
            "LINE_STRIP",
            "TRIANGLES",
            "TRIANGLE_STRIP",
            "TRIANGLE_FAN",
            "ZERO",
            "ONE",
            "SRC_COLOR",
            "ONE_MINUS_SRC_COLOR",
            "SRC_ALPHA",
            "ONE_MINUS_SRC_ALPHA",
            "DST_ALPHA",
            "ONE_MINUS_DST_ALPHA",
            "DST_COLOR",
            "ONE_MINUS_DST_COLOR",
            "SRC_ALPHA_SATURATE",
            "FUNC_ADD",
            "BLEND_EQUATION",
            "BLEND_EQUATION_RGB",
            "BLEND_EQUATION_ALPHA",
            "FUNC_SUBTRACT",
            "FUNC_REVERSE_SUBTRACT",
            "BLEND_DST_RGB",
            "BLEND_SRC_RGB",
            "BLEND_DST_ALPHA",
            "BLEND_SRC_ALPHA",
            "CONSTANT_COLOR",
            "ONE_MINUS_CONSTANT_COLOR",
            "CONSTANT_ALPHA",
            "ONE_MINUS_CONSTANT_ALPHA",
            "BLEND_COLOR",
            "ARRAY_BUFFER",
            "ELEMENT_ARRAY_BUFFER",
            "ARRAY_BUFFER_BINDING",
            "ELEMENT_ARRAY_BUFFER_BINDING",
            "STREAM_DRAW",
            "STATIC_DRAW",
            "DYNAMIC_DRAW",
            "BUFFER_SIZE",
            "BUFFER_USAGE",
            "CURRENT_VERTEX_ATTRIB",
            "FRONT",
            "BACK",
            "FRONT_AND_BACK",
            "TEXTURE_2D",
            "CULL_FACE",
            "BLEND",
            "DITHER",
            "STENCIL_TEST",
            "DEPTH_TEST",
            "SCISSOR_TEST",
            "POLYGON_OFFSET_FILL",
            "SAMPLE_ALPHA_TO_COVERAGE",
            "SAMPLE_COVERAGE",
            "NO_ERROR",
            "INVALID_ENUM",
            "INVALID_VALUE",
            "INVALID_OPERATION",
            "OUT_OF_MEMORY",
            "CW",
            "CCW",
            "LINE_WIDTH",
            "ALIASED_POINT_SIZE_RANGE",
            "ALIASED_LINE_WIDTH_RANGE",
            "CULL_FACE_MODE",
            "FRONT_FACE",
            "DEPTH_RANGE",
            "DEPTH_WRITEMASK",
            "DEPTH_CLEAR_VALUE",
            "DEPTH_FUNC",
            "STENCIL_CLEAR_VALUE",
            "STENCIL_FUNC",
            "STENCIL_FAIL",
            "STENCIL_PASS_DEPTH_FAIL",
            "STENCIL_PASS_DEPTH_PASS",
            "STENCIL_REF",
            "STENCIL_VALUE_MASK",
            "STENCIL_WRITEMASK",
            "STENCIL_BACK_FUNC",
            "STENCIL_BACK_FAIL",
            "STENCIL_BACK_PASS_DEPTH_FAIL",
            "STENCIL_BACK_PASS_DEPTH_PASS",
            "STENCIL_BACK_REF",
            "STENCIL_BACK_VALUE_MASK",
            "STENCIL_BACK_WRITEMASK",
            "VIEWPORT",
            "SCISSOR_BOX",
            "COLOR_CLEAR_VALUE",
            "COLOR_WRITEMASK",
            "UNPACK_ALIGNMENT",
            "PACK_ALIGNMENT",
            "MAX_TEXTURE_SIZE",
            "MAX_VIEWPORT_DIMS",
            "SUBPIXEL_BITS",
            "RED_BITS",
            "GREEN_BITS",
            "BLUE_BITS",
            "ALPHA_BITS",
            "DEPTH_BITS",
            "STENCIL_BITS",
            "POLYGON_OFFSET_UNITS",
            "POLYGON_OFFSET_FACTOR",
            "TEXTURE_BINDING_2D",
            "SAMPLE_BUFFERS",
            "SAMPLES",
            "SAMPLE_COVERAGE_VALUE",
            "SAMPLE_COVERAGE_INVERT",
            "COMPRESSED_TEXTURE_FORMATS",
            "DONT_CARE",
            "FASTEST",
            "NICEST",
            "GENERATE_MIPMAP_HINT",
            "BYTE",
            "UNSIGNED_BYTE",
            "SHORT",
            "UNSIGNED_SHORT",
            "INT",
            "UNSIGNED_INT",
            "FLOAT",
            "DEPTH_COMPONENT",
            "ALPHA",
            "RGB",
            "RGBA",
            "LUMINANCE",
            "LUMINANCE_ALPHA",
            "UNSIGNED_SHORT_4_4_4_4",
            "UNSIGNED_SHORT_5_5_5_1",
            "UNSIGNED_SHORT_5_6_5",
            "FRAGMENT_SHADER",
            "VERTEX_SHADER",
            "MAX_VERTEX_ATTRIBS",
            "MAX_VERTEX_UNIFORM_VECTORS",
            "MAX_VARYING_VECTORS",
            "MAX_COMBINED_TEXTURE_IMAGE_UNITS",
            "MAX_VERTEX_TEXTURE_IMAGE_UNITS",
            "MAX_TEXTURE_IMAGE_UNITS",
            "MAX_FRAGMENT_UNIFORM_VECTORS",
            "SHADER_TYPE",
            "DELETE_STATUS",
            "LINK_STATUS",
            "VALIDATE_STATUS",
            "ATTACHED_SHADERS",
            "ACTIVE_UNIFORMS",
            "ACTIVE_ATTRIBUTES",
            "SHADING_LANGUAGE_VERSION",
            "CURRENT_PROGRAM",
            "NEVER",
            "LESS",
            "EQUAL",
            "LEQUAL",
            "GREATER",
            "NOTEQUAL",
            "GEQUAL",
            "ALWAYS",
            "KEEP",
            "REPLACE",
            "INCR",
            "DECR",
            "INVERT",
            "INCR_WRAP",
            "DECR_WRAP",
            "VENDOR",
            "RENDERER",
            "VERSION",
            "NEAREST",
            "LINEAR",
            "NEAREST_MIPMAP_NEAREST",
            "LINEAR_MIPMAP_NEAREST",
            "NEAREST_MIPMAP_LINEAR",
            "LINEAR_MIPMAP_LINEAR",
            "TEXTURE_MAG_FILTER",
            "TEXTURE_MIN_FILTER",
            "TEXTURE_WRAP_S",
            "TEXTURE_WRAP_T",
            "TEXTURE",
            "TEXTURE_CUBE_MAP",
            "TEXTURE_BINDING_CUBE_MAP",
            "TEXTURE_CUBE_MAP_POSITIVE_X",
            "TEXTURE_CUBE_MAP_NEGATIVE_X",
            "TEXTURE_CUBE_MAP_POSITIVE_Y",
            "TEXTURE_CUBE_MAP_NEGATIVE_Y",
            "TEXTURE_CUBE_MAP_POSITIVE_Z",
            "TEXTURE_CUBE_MAP_NEGATIVE_Z",
            "MAX_CUBE_MAP_TEXTURE_SIZE",
            "TEXTURE0",
            "TEXTURE1",
            "TEXTURE2",
            "TEXTURE3",
            "TEXTURE4",
            "TEXTURE5",
            "TEXTURE6",
            "TEXTURE7",
            "TEXTURE8",
            "TEXTURE9",
            "TEXTURE10",
            "TEXTURE11",
            "TEXTURE12",
            "TEXTURE13",
            "TEXTURE14",
            "TEXTURE15",
            "TEXTURE16",
            "TEXTURE17",
            "TEXTURE18",
            "TEXTURE19",
            "TEXTURE20",
            "TEXTURE21",
            "TEXTURE22",
            "TEXTURE23",
            "TEXTURE24",
            "TEXTURE25",
            "TEXTURE26",
            "TEXTURE27",
            "TEXTURE28",
            "TEXTURE29",
            "TEXTURE30",
            "TEXTURE31",
            "ACTIVE_TEXTURE",
            "REPEAT",
            "CLAMP_TO_EDGE",
            "MIRRORED_REPEAT",
            "FLOAT_VEC2",
            "FLOAT_VEC3",
            "FLOAT_VEC4",
            "INT_VEC2",
            "INT_VEC3",
            "INT_VEC4",
            "BOOL",
            "BOOL_VEC2",
            "BOOL_VEC3",
            "BOOL_VEC4",
            "FLOAT_MAT2",
            "FLOAT_MAT3",
            "FLOAT_MAT4",
            "SAMPLER_2D",
            "SAMPLER_CUBE",
            "VERTEX_ATTRIB_ARRAY_ENABLED",
            "VERTEX_ATTRIB_ARRAY_SIZE",
            "VERTEX_ATTRIB_ARRAY_STRIDE",
            "VERTEX_ATTRIB_ARRAY_TYPE",
            "VERTEX_ATTRIB_ARRAY_NORMALIZED",
            "VERTEX_ATTRIB_ARRAY_POINTER",
            "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",
            "IMPLEMENTATION_COLOR_READ_TYPE",
            "IMPLEMENTATION_COLOR_READ_FORMAT",
            "COMPILE_STATUS",
            "LOW_FLOAT",
            "MEDIUM_FLOAT",
            "HIGH_FLOAT",
            "LOW_INT",
            "MEDIUM_INT",
            "HIGH_INT",
            "FRAMEBUFFER",
            "RENDERBUFFER",
            "RGBA4",
            "RGB5_A1",
            "RGB565",
            "DEPTH_COMPONENT16",
            "STENCIL_INDEX8",
            "DEPTH_STENCIL",
            "RENDERBUFFER_WIDTH",
            "RENDERBUFFER_HEIGHT",
            "RENDERBUFFER_INTERNAL_FORMAT",
            "RENDERBUFFER_RED_SIZE",
            "RENDERBUFFER_GREEN_SIZE",
            "RENDERBUFFER_BLUE_SIZE",
            "RENDERBUFFER_ALPHA_SIZE",
            "RENDERBUFFER_DEPTH_SIZE",
            "RENDERBUFFER_STENCIL_SIZE",
            "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",
            "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",
            "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",
            "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",
            "COLOR_ATTACHMENT0",
            "DEPTH_ATTACHMENT",
            "STENCIL_ATTACHMENT",
            "DEPTH_STENCIL_ATTACHMENT",
            "NONE",
            "FRAMEBUFFER_COMPLETE",
            "FRAMEBUFFER_INCOMPLETE_ATTACHMENT",
            "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",
            "FRAMEBUFFER_INCOMPLETE_DIMENSIONS",
            "FRAMEBUFFER_UNSUPPORTED",
            "FRAMEBUFFER_BINDING",
            "RENDERBUFFER_BINDING",
            "MAX_RENDERBUFFER_SIZE",
            "INVALID_FRAMEBUFFER_OPERATION",
            "UNPACK_FLIP_Y_WEBGL",
            "UNPACK_PREMULTIPLY_ALPHA_WEBGL",
            "CONTEXT_LOST_WEBGL",
            "UNPACK_COLORSPACE_CONVERSION_WEBGL",
            "BROWSER_DEFAULT_WEBGL",
            "activeTexture",
            "attachShader",
            "bindAttribLocation",
            "bindRenderbuffer",
            "blendColor",
            "blendEquation",
            "blendEquationSeparate",
            "blendFunc",
            "blendFuncSeparate",
            "bufferData",
            "bufferSubData",
            "checkFramebufferStatus",
            "compileShader",
            "compressedTexImage2D",
            "compressedTexSubImage2D",
            "copyTexImage2D",
            "copyTexSubImage2D",
            "createBuffer",
            "createFramebuffer",
            "createProgram",
            "createRenderbuffer",
            "createShader",
            "createTexture",
            "cullFace",
            "deleteBuffer",
            "deleteFramebuffer",
            "deleteProgram",
            "deleteRenderbuffer",
            "deleteShader",
            "deleteTexture",
            "depthFunc",
            "depthMask",
            "depthRange",
            "detachShader",
            "disable",
            "enable",
            "finish",
            "flush",
            "framebufferRenderbuffer",
            "framebufferTexture2D",
            "frontFace",
            "generateMipmap",
            "getActiveAttrib",
            "getActiveUniform",
            "getAttachedShaders",
            "getAttribLocation",
            "getBufferParameter",
            "getContextAttributes",
            "getError",
            "getExtension",
            "getFramebufferAttachmentParameter",
            "getParameter",
            "getProgramInfoLog",
            "getProgramParameter",
            "getRenderbufferParameter",
            "getShaderInfoLog",
            "getShaderParameter",
            "getShaderPrecisionFormat",
            "getShaderSource",
            "getSupportedExtensions",
            "getTexParameter",
            "getUniform",
            "getUniformLocation",
            "getVertexAttrib",
            "getVertexAttribOffset",
            "hint",
            "isBuffer",
            "isContextLost",
            "isEnabled",
            "isFramebuffer",
            "isProgram",
            "isRenderbuffer",
            "isShader",
            "isTexture",
            "lineWidth",
            "linkProgram",
            "pixelStorei",
            "polygonOffset",
            "readPixels",
            "renderbufferStorage",
            "sampleCoverage",
            "shaderSource",
            "stencilFunc",
            "stencilFuncSeparate",
            "stencilMask",
            "stencilMaskSeparate",
            "stencilOp",
            "stencilOpSeparate",
            "texImage2D",
            "texParameterf",
            "texParameteri",
            "texSubImage2D",
            "useProgram",
            "validateProgram",
            "bindBuffer",
            "bindFramebuffer",
            "bindTexture",
            "clear",
            "clearColor",
            "clearDepth",
            "clearStencil",
            "colorMask",
            "disableVertexAttribArray",
            "drawArrays",
            "drawElements",
            "enableVertexAttribArray",
            "scissor",
            "uniform1f",
            "uniform1fv",
            "uniform1i",
            "uniform1iv",
            "uniform2f",
            "uniform2fv",
            "uniform2i",
            "uniform2iv",
            "uniform3f",
            "uniform3fv",
            "uniform3i",
            "uniform3iv",
            "uniform4f",
            "uniform4fv",
            "uniform4i",
            "uniform4iv",
            "uniformMatrix2fv",
            "uniformMatrix3fv",
            "uniformMatrix4fv",
            "vertexAttrib1f",
            "vertexAttrib1fv",
            "vertexAttrib2f",
            "vertexAttrib2fv",
            "vertexAttrib3f",
            "vertexAttrib3fv",
            "vertexAttrib4f",
            "vertexAttrib4fv",
            "vertexAttribPointer",
            "viewport",
            "drawingBufferFormat",
            "RGB8",
            "RGBA8",
            "drawingBufferStorage",
            "constructor",
            "makeXRCompatible"
        ]
    }
    if (res.includes("adAuctionHeaders") && res.includes('allowPaymentRequest') && !res.includes('hreflang')) {
        res = [
            "src",
            "srcdoc",
            "name",
            "sandbox",
            "allowFullscreen",
            "width",
            "height",
            "contentDocument",
            "contentWindow",
            "referrerPolicy",
            "csp",
            "allow",
            "featurePolicy",
            "loading",
            "align",
            "scrolling",
            "frameBorder",
            "longDesc",
            "marginHeight",
            "marginWidth",
            "getSVGDocument",
            "credentialless",
            "allowPaymentRequest",
            "constructor",
            "privateToken",
            "browsingTopics",
            "adAuctionHeaders",
            "sharedStorageWritable"
        ]
    }
    if (a === Set.prototype) {
        res = [
            "constructor",
            "has",
            "add",
            "delete",
            "clear",
            "entries",
            "forEach",
            "size",
            "values",
            "keys",
            "union",
            "intersection",
            "difference",
            "symmetricDifference",
            "isSubsetOf",
            "isSupersetOf",
            "isDisjointFrom"
        ]
    }
    if (res.includes('ownerSVGElement') && res.includes('viewportElement')) {
        res = [
            "className",
            "ownerSVGElement",
            "viewportElement",
            "onbeforexrselect",
            "onabort",
            "onbeforeinput",
            "onbeforematch",
            "onbeforetoggle",
            "onblur",
            "oncancel",
            "oncanplay",
            "oncanplaythrough",
            "onchange",
            "onclick",
            "onclose",
            "oncontentvisibilityautostatechange",
            "oncontextlost",
            "oncontextmenu",
            "oncontextrestored",
            "oncuechange",
            "ondblclick",
            "ondrag",
            "ondragend",
            "ondragenter",
            "ondragleave",
            "ondragover",
            "ondragstart",
            "ondrop",
            "ondurationchange",
            "onemptied",
            "onended",
            "onerror",
            "onfocus",
            "onformdata",
            "oninput",
            "oninvalid",
            "onkeydown",
            "onkeypress",
            "onkeyup",
            "onload",
            "onloadeddata",
            "onloadedmetadata",
            "onloadstart",
            "onmousedown",
            "onmouseenter",
            "onmouseleave",
            "onmousemove",
            "onmouseout",
            "onmouseover",
            "onmouseup",
            "onmousewheel",
            "onpause",
            "onplay",
            "onplaying",
            "onprogress",
            "onratechange",
            "onreset",
            "onresize",
            "onscroll",
            "onsecuritypolicyviolation",
            "onseeked",
            "onseeking",
            "onselect",
            "onslotchange",
            "onstalled",
            "onsubmit",
            "onsuspend",
            "ontimeupdate",
            "ontoggle",
            "onvolumechange",
            "onwaiting",
            "onwebkitanimationend",
            "onwebkitanimationiteration",
            "onwebkitanimationstart",
            "onwebkittransitionend",
            "onwheel",
            "onauxclick",
            "ongotpointercapture",
            "onlostpointercapture",
            "onpointerdown",
            "onpointermove",
            "onpointerrawupdate",
            "onpointerup",
            "onpointercancel",
            "onpointerover",
            "onpointerout",
            "onpointerenter",
            "onpointerleave",
            "onselectstart",
            "onselectionchange",
            "onanimationend",
            "onanimationiteration",
            "onanimationstart",
            "ontransitionrun",
            "ontransitionstart",
            "ontransitionend",
            "ontransitioncancel",
            "oncopy",
            "oncut",
            "onpaste",
            "dataset",
            "nonce",
            "autofocus",
            "tabIndex",
            "style",
            "attributeStyleMap",
            "blur",
            "focus",
            "onscrollend",
            "onscrollsnapchange",
            "onscrollsnapchanging",
            "constructor"
        ]
    }
    if (res[0] === 'constructor' && res[1] === 'delete' && res[2] === 'get') {
        return res
    }
    if (res[0] === 'constructor' && res[1] === 'get' && res[2] === 'set') {
        return res
    }
    if (res.includes('DOMSTRING_SIZE_ERR') && res.includes('NOT_SUPPORTED_ERR')) {
        res = [
            "code",
            "name",
            "message",
            "INDEX_SIZE_ERR",
            "DOMSTRING_SIZE_ERR",
            "HIERARCHY_REQUEST_ERR",
            "WRONG_DOCUMENT_ERR",
            "INVALID_CHARACTER_ERR",
            "NO_DATA_ALLOWED_ERR",
            "NO_MODIFICATION_ALLOWED_ERR",
            "NOT_FOUND_ERR",
            "NOT_SUPPORTED_ERR",
            "INUSE_ATTRIBUTE_ERR",
            "INVALID_STATE_ERR",
            "SYNTAX_ERR",
            "INVALID_MODIFICATION_ERR",
            "NAMESPACE_ERR",
            "INVALID_ACCESS_ERR",
            "VALIDATION_ERR",
            "TYPE_MISMATCH_ERR",
            "SECURITY_ERR",
            "NETWORK_ERR",
            "ABORT_ERR",
            "URL_MISMATCH_ERR",
            "QUOTA_EXCEEDED_ERR",
            "TIMEOUT_ERR",
            "INVALID_NODE_TYPE_ERR",
            "DATA_CLONE_ERR",
            "constructor"
        ]
        return res
    }
    // if (res[0] === 'constructor' && !res.includes('setUTCMinutes') && !res.includes('BYTES_PER_ELEMENT')
    //     && (!res.includes('message') || res.includes('linePos'))
    //     // && !res.includes('has')
    //     && !res.includes('flatMap')
    //     && !res.includes('spellcheck')
    //     && !res.includes('isExtended')
    //     && !res.includes('finally')
    //     && !res.includes('toPrecision')
    //     && !res.includes('deref')
    //     && !res.includes('__lookupGetter__')
    //     && !res.includes('symmetricDifference')
    //     // && !res.includes('audioWorklet')
    // ) {
    //     res = res.slice(1,)
    //     res.push('constructor')
    // }
    if (res.includes('exec') && res.includes('dotAll')) {
        res = [
            "constructor",
            "exec",
            "dotAll",
            "flags",
            "global",
            "hasIndices",
            "ignoreCase",
            "multiline",
            "source",
            "sticky",
            "unicode",
            "unicodeSets",
            "compile",
            "toString",
            "test"
        ]
    }
    if (res.includes('orientation') && res.includes('isExtended')) {
        res = [
            "availWidth",
            "availHeight",
            "width",
            "height",
            "colorDepth",
            "pixelDepth",
            "availLeft",
            "availTop",
            "orientation",
            "constructor",
            "onchange",
            "isExtended"
        ]
    }
    if (res.includes('deliveredFrames')) {

    }

    if (res.includes('getBigUint64')) {
        res = [
            "constructor",
            "buffer",
            "byteLength",
            "byteOffset",
            "getInt8",
            "setInt8",
            "getUint8",
            "setUint8",
            "getInt16",
            "setInt16",
            "getUint16",
            "setUint16",
            "getInt32",
            "setInt32",
            "getUint32",
            "setUint32",
            "getFloat32",
            "setFloat32",
            "getFloat64",
            "setFloat64",
            "getBigInt64",
            "setBigInt64",
            "getBigUint64",
            "setBigUint64"
        ]
    }
//     if (res.includes('entries') && res.includes('clear')){
//         res= [
//     "get",
//     "set",
//     "has",
//     "delete",
//     "clear",
//     "entries",
//     "forEach",
//     "keys",
//     "size",
//     "values",
//     "constructor",
//
// ]
//     }
    print('getOwnPropertyNames', res + '')
    _print('getOwnPropertyNames1', res + '')

    res = new Proxy(res, {
        get(target, p, receiver) {
            let res = Reflect.get(target, p, receiver)

            _print('res.get', p, '=', res)
            if (target.length === 1197) {
                return 'StorageBucketManager'
            }
            return res;
        }
    })
    return res;

})
_getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;
Object.getOwnPropertyDescriptors = newFunc('getOwnPropertyDescriptors', 1, function (a) {
    let res = _getOwnPropertyDescriptors(a);
    print('getOwnPropertyDescriptors', a.toString())
    // res = new Proxy(res, {
    //     get(target, p, receiver) {
    //         let res = Reflect.get(target, p, receiver)
    //         print('getOwnPropertyDescriptors',p,'=',typeof res);
    //         return res;
    //     }
    // })
    return res;
})
_getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
Object.getOwnPropertyDescriptor = newFunc('getOwnPropertyDescriptor', 2, function (a, b) {
    let res = _getOwnPropertyDescriptor(a, b);
    print('getOwnPropertyDescriptor', a.toString(), b, '=', res)
    return res;
})
//

get_all_node = function () {
    let root = $.root();
    return $.root().find('*');
}
// Function.prototype = new Proxy(Function.prototype, {
//     set(target, p, newValue, receiver) {
//         print('pppp', p)
//         debugger;
//         Reflect.set(target, p, newValue, receiver)
//     }
// })
// // Function.prototype.toString = function (){}
// getFuncToString(Function)





